package com.aaa.book_mall.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Date;

/**
 * @Description: 客户表
 * @ClassName: User
 * @Author: fengyun
 * @Date: 2021/2/21 10:36
 * @Version: 1.0
 */
@Component
public class User implements Serializable {
    private Integer uid;
    private String username;
    private String password;
    private String sex;
    private String phone;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    //数据从后台发到前台显示时间戳格式，使用以下注解解决问题。
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date birthday;
    private String authcodeR;

    public User() {
    }

    public User(Integer uid, String username, String password, String sex, String phone, Date birthday, String authcodeR) {
        this.uid = uid;
        this.username = username;
        this.password = password;
        this.sex = sex;
        this.phone = phone;
        this.birthday = birthday;
        this.authcodeR = authcodeR;
    }

    public User(Integer uid, String username, String password, String sex, String phone, Date birthday) {
        this.uid = uid;
        this.username = username;
        this.password = password;
        this.sex = sex;
        this.phone = phone;
        this.birthday = birthday;
    }

    public User(String username, String password, String sex, String phone, Date birthday) {
        this.username = username;
        this.password = password;
        this.sex = sex;
        this.phone = phone;
        this.birthday = birthday;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getAuthcodeR() {
        return authcodeR;
    }

    public void setAuthcodeR(String authcodeR) {
        this.authcodeR = authcodeR;
    }

    @Override
    public String toString() {
        return "User{" +
                "uid=" + uid +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", sex='" + sex + '\'' +
                ", phone='" + phone + '\'' +
                ", birthday=" + birthday +
                ", authcodeR='" + authcodeR + '\'' +
                '}';
    }
}
